using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Brick : MonoBehaviour,IDamageable
{
    [SerializeField] private bool _canDestructible;
    [SerializeField]private GameObject _effect;
   
    public void TakeDamage(AttackDetail detail) 
    {
        AudioManager.Instance.PlaySound(SoundType.HitBrick);
        if (_canDestructible) 
        {
            if (_effect != null) 
            {
                EffectManager.Instance.Play(_effect,transform.position,1);
            }
            Destroy(gameObject);
        }
    }



   
}
